feat(predict): remove CLOB v1 support and migrate to pUSD cp-7.76.0#29451
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
4e3b5ca to
ac40f1d
Compare
a8fc740 to
80436b3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #29451 +/- ##
==========================================
- Coverage 81.86% 81.42% -0.44%
==========================================
Files 5255 5301 +46
Lines 138980 140423 +1443
Branches 31518 31956 +438
==========================================
+ Hits 113774 114345 +571
- Misses 17465 18257 +792
- Partials 7741 7821 +80 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6ff7cb7 to
80436b3
Compare
# By metamaskbot (20) and others # Via GitHub (10) and others * main: (144 commits) fix: transaction page display and alerts for money account transactions (#29725) feat: replace assets state references in Engine (#29727) fix: display non ETH native transactions in the native token detail page (#28977) chore(card): migrate Card BigInt usage to new library (#29679) fix(perps): suppress transient HL SDK errors from Sentry (#29642) feat: bump Accounts dependencies (#29621) feat(ramp): bypass order-processing redirect in headless flows (Phase 6) (#29340) feat: tempo disable tx management for testnet moderato (#29425) feat: support max money account deposit for ERC-20 tokens (#29605) fix(BETR-413): pass originalTransactionId for intent bridge history cp-7.76.0 (#29670) feat: add hook for updating MM pay transaction amount update for money account deposits (#29561) chore: explore v2 nit fixes (#29720) test: MMQA -1712-[Mobile] Update the mobile e2e tests to account for home page redesign enabled (#29100) feat: display 5 year projected balance on money account deposit page (#29607) feat(rewards): add Perps Trading Campaign (#29323) ci: extract mobile CI status gate (#29619) fix(ci): improve CocoaPods install resilience against CDN rate limiting (#29334) fix(ci): add restore-keys and continue-on-error to yarn cache (#29277) chore: TSA-488-1 bump ai-controller (#29678) fix: top traders section disappears on fetch error (#29501) ... # Conflicts: # app/components/UI/Predict/hooks/usePredictBalanceTokenFilter.test.ts # app/components/UI/Predict/hooks/usePredictBalanceTokenFilter.ts # app/components/UI/Predict/providers/polymarket/utils.test.ts
80f5c73 to
d9f1abb
Compare
* main: chore: set user timezone in chart (#29654) fix: MUSD-771 updated selectAccountTokensAcrossChainsUnified to select tokens across chains for evm-scope specifically cp-7.76.0 (#29675) fix: resolve `ORDER_PRICE_REQUIRED` error on perps position flip (#29691) fix(activity): restore Perps after popular networks without forcing Ethereum (#29676) fix: resolve token block explorer from network configurations (#29686) chore: New Crowdin Translations by GitHub Action cp-7.76.0 (#29535) feat: TSA 488-2 Whats Happening expanded view + Explore page (#29681) test(e2e): mock popular network RPCs to remove from allowlist (MMQA-1785) (#29682) feat(analytics): emit dapp_name + dapp_url on Remote Connection Request Received/Failed (#29746) fix: make in-app webview back button tappable on iOS (#29693)
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: SmokePredictions (primary): All Predictions E2E tests must run because:
SmokeConfirmations (required per tag description): The SmokeWalletPlatform (required per tag description): SmokePredictions description states 'also select SmokeWalletPlatform (Trending section)' since Perps/Predictions are sections inside the Trending tab. Not selected: SmokeAccounts, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokeBrowser, SmokeSnaps, SmokeSeedlessOnboarding - none of these are affected by Polymarket CLOB v2 migration changes. Performance Test Selection: |
|
|
Adding @cryptotavares to the Predict team temporarily so he can approve the PR, since all available team members have touched the PR and cannot approve it anymore. |



Description
This PR removes legacy Predict Polymarket CLOB v1 support and completes the pUSD migration in Predict-owned code.
It includes:
pUSD + legacy USDC.e).Stack note: this PR is stacked on the confirmations-only pUSD PR so the diff stays limited to Predict-owned files.
Changelog
CHANGELOG entry: Updated Predict to use pUSD and the Polymarket CLOB v2 protocol.
Related issues
Fixes: PRED-851 , PRED-852
Manual testing steps
Screenshots/Recordings
Before
N/A — code-only protocol migration PR; no screenshots captured.
After
N/A — code-only protocol migration PR; no screenshots captured.
Testing
yarn lint:tscyarn jest app/components/UI/Predict/providers/polymarket/protocol/definitions.test.ts app/components/UI/Predict/providers/polymarket/protocol/orderCodec.test.ts app/components/UI/Predict/providers/polymarket/protocol/transport.test.ts app/components/UI/Predict/providers/polymarket/preflight/v2AllowanceRequirements.test.ts app/components/UI/Predict/providers/polymarket/preflight/withdraw.test.ts app/components/UI/Predict/providers/polymarket/preflight/workflows.test.ts app/components/UI/Predict/providers/polymarket/PolymarketProvider.test.ts app/components/UI/Predict/controllers/PredictController.test.ts app/components/UI/Predict/hooks/usePredictBalanceTokenFilter.test.ts app/components/UI/Predict/hooks/usePredictRewards.test.ts app/components/UI/Predict/views/PredictBuyWithAnyToken/components/PredictPayWithRow/PredictPayWithRow.test.tsx --runInBand --forceExitPre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Updates on-chain token identifiers/addresses used for Predict gas fee and rewards calculations, which could impact transactions if misconfigured. Changes are localized to Predict hooks/controller and accompanying tests.
Overview
Predict now consistently references the pUSD / CLOB v2 collateral across Predict-owned code:
PredictControllerusesMATIC_CONTRACTS_V2.collateralas thegasFeeTokenfor claim/withdrawaddTransactionBatch,usePredictBalanceTokenFilterdisplays the Predict balance row using thePOLYGON_PUSDtoken (icon + symbol), andusePredictRewardsestimates points usingPOLYGON_PUSD_CAIP_ASSET_ID.Cleans up account-state handling by removing
hasAllowancesexpectations/tests and updatingusePredictAccountStatedocs to reflect the slimmerAccountStateshape.Reviewed by Cursor Bugbot for commit 7dfda61. Bugbot is set up for automated code reviews on this repo. Configure here.